﻿@model Sample.Web.Areas.Sample.Models.PersonQueryModel

@*IEnumerable<Sample.BusinessEntities.PersonModel>*@

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            Sample List
            <small>demo</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
            <li><a href="#">Sample</a></li>
            <li class="active">Index</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header">
                        <h3 class="box-title"></h3>

                        <fieldset>
                            <legend>查询</legend>
                            @using (Ajax.BeginForm("Index", new RouteValueDictionary { { "page", "" } }, new AjaxOptions { UpdateTargetId = "personlist", HttpMethod = "Get", InsertionMode = InsertionMode.Replace }, new RouteValueDictionary { { "id", "searchForm" }, { "class", "form-horizontal " } }))
                            {
                                <div class="form-group col-md-6">
                                    @Html.LabelFor(model => model.Name, htmlAttributes: new { @class = "control-label col-md-2" })
                                    <div class="col-md-10">
                                        @Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "form-control" } })
                                        @Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger" })
                                    </div>
                                </div>

                                <div class="form-group col-md-6">
                                    @Html.LabelFor(model => model.BirthDate, htmlAttributes: new { @class = "control-label col-md-2" })
                                    <div class="input-group date">
                                        <!--data-provide="datepicker"-->
                                        <div class="input-group-addon">
                                            <span class="glyphicon glyphicon-th"></span>
                                        </div>
                                        @Html.EditorFor(model => model.BirthDate, new { htmlAttributes = new { @class = "form-control", autocomplete = "off", disableautocomplete = "disableautocomplete" } })

                                        @Html.ValidationMessageFor(model => model.BirthDate, "", new { @class = "text-danger" })
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-md-offset-1 col-md-10">
                                        <input type="submit" value="查询" class="btn btn-default" />
                                    </div>
                                </div>
                            }
                        </fieldset>

                    </div>
                    <!-- /.box-header -->
                    <div class="box-body" id="personlist">
                        @Html.Partial("_PersonList", Model.PersonModels)

                        @*<p>
                                @Html.ActionLink("Create New", "Create", null, new { @class = "btn btn-default" })
                            </p>*@
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- /.content -->
</div>
<!-- /.content-wrapper -->

@section Scripts
{


    <script type="text/javascript" src="/Scripts/jquery.unobtrusive-ajax.min.js"></script>
    <script type="text/javascript" src="/Scripts/MvcPager.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {

            $("#BirthDate").datepicker({ autoclose: true, language: 'zh-CN', clearBtn: true, todayHighlight: true, format: 'yyyy/mm/dd' });


            //$("#person_tab").DataTable({
            //    'paging': false,
            //    'lengthChange': false,
            //    'searching': false,
            //    'ordering': false,
            //    'info': false,
            //    'autoWidth': false
            //})
        })
    </script>

}